package com.wx.stringbuffer_;

import java.util.Scanner;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/7/13 - 9:54
 */
public class StringBufferExercise02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入价格");
//        double price = scanner.nextDouble();
        String price = scanner.next();
//        String s = String.valueOf(price);
        StringBuffer sb = new StringBuffer(price);
        for (int i = sb.lastIndexOf(".") - 3; i > 0; i -= 3) {
            sb = sb.insert(i, ",");
        }
        System.out.println(sb);
    }
}
